namespace Jumpton.SFA.Server.Entity
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using Jumpton.Persistent;
    using System.Data;
    using System.Runtime.Serialization;


    [System.SerializableAttribute()]
    [Map("USERS")]
    public class USERS : ObjectRow
    {

        public USERS()
        {
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataRow">DataTable 中的一行数据</param>
        /// <param name="objectTable">存储当前对象的数据表格</param>
        public USERS(System.Data.DataRow dataRow, ObjectTable parent) :
            base(dataRow, parent)
        {
        }

        /// <summary>
        /// 供反序列化使用的构造函数
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected USERS(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) :
            base(info, context)
        {
        }

        [Key("ID",true,true)]
        public decimal ID
        {
            get
            {
                return (System.Decimal)GetValue("ID");
            }
            set
            {
                SetValue("ID", value);
            }
        }

        [Field("CODE")]
        public string CODE
        {
            get
            {
                return (System.String)GetValue("CODE");
            }
            set
            {
                SetValue("CODE", value);
            }
        }

        [Field("Profile_Code")]
        public string ProfileCode
        {
            get
            {
                return (System.String)GetValue("ProfileCode");
            }
            set
            {
                SetValue("ProfileCode", value);
            }
        }

        [Field("PASSWORD")]
        public string PASSWORD
        {
            get
            {
                return (System.String)GetValue("PASSWORD");
            }
            set
            {
                SetValue("PASSWORD", value);
            }
        }

        [Field("PERSON_ID")]
        public decimal PERSONID
        {
            get
            {
                return (System.Decimal)GetValue("PERSONID");
            }
            set
            {
                SetValue("PERSONID", value);
            }
        }
        [CalculateField]
        public Person PERSON
        {
            get
            {
                ObjectRow or = null;
                or = ObjectRow.Load(typeof(Person), "this.ID=" + PERSONID.ToString());
                if (or != null)
                {
                    return (Person)or;
                }
                return null;
            }

        }

       

        [Field("GROUP_ID")]
        public decimal GROUPID
        {
            get
            {
                return (System.Decimal)GetValue("GROUPID");
            }
            set
            {
                SetValue("GROUPID", value);
            }
        }

        [Field("ORG_ID")]
        public int ORGID
        {
            get
            {
                return (System.Int32)GetValue("ORGID");
            }
            set
            {
                SetValue("ORGID", value);
            }
        }

        [Field("RIGHTS")]
        public string RIGHTS
        {
            get
            {
                return (System.String)GetValue("RIGHTS");
            }
            set
            {
                SetValue("RIGHTS", value);
            }
        }

        [Field("DOMAIN_ID")]
        public decimal DOMAINID
        {
            get
            {
                return (System.Decimal)GetValue("DOMAINID");
            }
            set
            {
                SetValue("DOMAINID", value);
            }
        }

        [Field("LAST_UPDATER")]
        public string LAST_UPDATER
        {
            get
            {
                return (System.String)GetValue("LAST_UPDATER");
            }
            set
            {
                SetValue("LAST_UPDATER", value);
            }
        }

        [Field("LAST_UPDATE_TIME")]
        public Decimal LAST_UPDATE_TIME
        {
            get
            {
                return (System.Decimal)GetValue("LAST_UPDATE_TIME");
            }
            set
            {
                SetValue("LAST_UPDATE_TIME", value);
            }
        }

        [Field("FORCE_EXPORT_ALL")]
        public string FORCEEXPORTALL
        {
            get
            {
                return (System.String)GetValue("FORCEEXPORTALL");
            }
            set
            {
                SetValue("FORCEEXPORTALL", value);
            }
        }

        [Field("RESET_FLAG")]
        public string RESETFLAG
        {
            get
            {
                return (System.String)GetValue("RESETFLAG");
            }
            set
            {
                SetValue("RESETFLAG", value);
            }
        }

        [Field("ISLOCK")]
        public bool ISLOCK
        {
            get
            {
                return (System.Boolean)GetValue("ISLOCK");
            }
            set
            {
                SetValue("ISLOCK", value);
            }
        }

        [Field("FAILLOGINCOUNT")]
        public string FAILLOGINCOUNT
        {
            get
            {
                return (System.String)GetValue("FAILLOGINCOUNT");
            }
            set
            {
                SetValue("FAILLOGINCOUNT", value);
            }
        }

        [Field("UserToken")]
        public string UserToken
        {
            get
            {
                return (System.String)GetValue("UserToken");
            }
            set
            {
                SetValue("UserToken", value);
            }
        }

        [Field("PASSWORDCHANGED")]
        public bool PASSWORDCHANGED
        {
            get
            {
                return (System.Boolean)GetValue("PASSWORDCHANGED");
            }
            set
            {
                SetValue("PASSWORDCHANGED", value);
            }
        }

        [Field("ACTIVE")]
        public Boolean ACTIVE
        {
            get
            {
                return (System.Boolean)GetValue("ACTIVE");
            }
            set
            {
                SetValue("ACTIVE", value);
            }
        }

        [Field("TYPE")]
        public int TYPE
        {
            get
            {
                return (System.Int32)GetValue("TYPE");
            }
            set
            {
                SetValue("TYPE", value);
            }
        }
        [Field("KIND")]
        public string KIND
        {
            get
            {
                return (System.String)GetValue("KIND");
            }
            set
            {
                SetValue("KIND", value);
            }
        }
        [Field("HOLIDAY")]
        public string HOLIDAY
        {
            get
            {
                return (System.String)GetValue("HOLIDAY");
            }
            set
            {
                SetValue("HOLIDAY", value);
            }
        }
        [Field("USERTYPE")]
        public int USERTYPE
        {
            get
            {
                return (System.Int32)GetValue("USERTYPE");
            }
            set
            {
                SetValue("USERTYPE", value);
            }
        }
       
    }
}
